#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
void MergeSort(int* a, int n) {
	int* tmp = (int*)malloc(sizeof(int) * n);
	if (tmp == NULL) {
		perror("malloc fail");
		return;
	}
	if (n <= 1) {
		return;
	}
	int mid = (n + 1) / 2;//n=3,mid=2,[0,mid-1]
	MergeSort(a, mid);
	MergeSort(a + mid, n- mid);
	//
	int begin1 = 0;
	int begin2 = mid;

	int i = 0;
	while (begin1 <= mid - 1 && begin2 <= n - 1) {
		if (a[begin1] < a[begin2]) {
			tmp[i] = a[begin1];
			i++;
			begin1++;
		}
		else {
			tmp[i] = a[begin2];
			i++;
			begin2++;
		}
	}
	while (begin1 <= mid - 1) {
		tmp[i] = a[begin1];
		i++;
		begin1++;
	}
	while (begin2 <= n - 1) {
		tmp[i] = a[begin2];
		i++;
		begin2++;
	}
	memcpy(a, tmp, sizeof(int) * n);
	return;
}



int main() {
	int n = 0;
	scanf("%d", &n);
	int arr[4] = {4,3,2,1};
	for (int i = 0; i < 5; i++) {
		printf("%d ", arr[i]);
	}
	MergeSort(arr, 4);
	for(int i = 0; i < 5; i++) {
		printf("%d ", arr[i]);
	}
   

	return 0;
}